{include file="common/head"}
<head>
<title>学员信息编辑</title>
</head>
<body style="">
    <div class="container p-3 my-3 " style="max-width: 600px;"  >
    <h2>学员信息编辑 (No.{$data.id})</h2>
    <form method="post" action="/index.php/customer/edit" enctype="multipart/form-data">

      <input type="hidden" name="id" id="id" value="{$data.id}" />

     
      <div class="mb-3 mt-3">
        <!-- <lable for="name" class="form-label">编号:</label> -->
        <input type="hidden" class="form-control" value="{$data.id}" placeholder="" disabled />
      </div>
      <div class="mb-3">
        <label for="name" class="form-label">姓名:</label>
        <input type="text" class="form-control" id="name" name="name" value="{$data.name}" placeholder="" />
      </div>
      <div class="mb-3">
        <label for="address" class="form-label">地址:</label>
        <input type="text" class="form-control" id="address" name="address" value="{$data.address}" placeholder="" />
      </div>
      <div class="mb-3">
        <label for="mobile" class="form-label">手机号码:</label>
        <input type="text" class="form-control" id="mobile" name="mobile" value="{$data.mobile}" disabled />
      </div>
<!--       <div class="mb-3">
        <label for="wx" class="form-label">微信号:</label>
        <input type="text" class="form-control" id="wx" name="wx" value="{$data.wx}" placeholder="" />
      </div> -->
      <div class="mb-3">
        <label for="birth_date" class="form-label">出生日期(Birth date):</label>
        <input type="text" class="form-control" id="birth_date" name="birth_date" value="{$data.birth_date}" disabled />
      </div>
      <div class="mb-3">
        <label for="sex" class="form-label">性别(SEX):</label>
          <input type="radio" class="form-check-input" id="radio1" name="sex" value="1" {if $data.sex==1} checked {/if}/> 
          <label class="form-check-label" for="radio1">男(Man)</label>
          <input type="radio" class="form-check-input" id="radio2" name="sex" value="2" {if $data.sex==2} checked {/if}/>
          <label class="form-check-label" for="radio2">女(Female)</label>
      </div>
      <div class="mb-3">
        <label for="inviter_name" class="form-label">邀请人:<c class="text-primary">{$data.inviter_name}</c></label>

      </div>
      <div class="mb-3">
        <label for="status" class="form-label">是否启用:</label>
          <input type="radio" class="form-check-input" id="radio3" name="status" value="1" {if $data.status==1} checked {/if}/> 
          <label class="form-check-label" for="radio3">启用</label>
          <input type="radio" class="form-check-input" id="radio4" name="status" value="2" {if $data.status==2} checked {/if}/>
          <label class="form-check-label" for="radio4">关闭</label>
       </div>
      <div class="mb-3">
        <img src="{$data.image}" style="width: 140px;"/><br />
        <label for="file" class="form-label">上传图片(Image):</label>
        <input type="file"  name="file" /> <br> 
      </div>   
      <button  type="button" class="btn btn-primary" onclick="doSave()">保存(Save)</button>

    </form>
    </div>

<script type="text/javascript">
    function doSave(){
      if(!$("#name").val()) {
        layer.msg("无效的名称(Invalid name)!");
        return 0;
      }    
      if(!$("#mobile").val()) {
        layer.msg("无效的电话(Invalid mobile)!");
        return 0;
      }

      if(isNaN($("#commision").val()) || $("#commision").val()*1>0.05){
        layer.msg("佣金比例不正确(0.00-0.05)");
        return;
      }

      //询问框
      layer.confirm('是否确定保存?', {
        btn: ['YES','CANCEL'] //按钮
      }, function(){
        $('form').submit();
      }, function(){
        layer.msg("Cancel!");
        return 0;
      });
    }

</script>


</body>
</html>
